<template>
    <j-modal :title="title" :width="width" :visible="visible" :maskClosable="false" :keyboard="false"
        :forceRender="true" :style="modalStyle" @cancel="handleCancel" wrapClassName="ant-modal-cust-warp">
        <template slot="footer">
            <a-button v-if="billType === '零售出库'" @click="onPrint">小票打印</a-button>
            <!-- <a-button v-if="billPrintFlag" @click="handlePrint">三联打印预览</a-button> -->

            <a-button v-if="billType === '销售订单' && model.status != 0" v-print="'#saleOrderSanPrint'">三联打印预览</a-button>
            <!--此处为解决缓存问题-->
            <a-button v-if="billType === '零售出库'" v-print="'#retailOutPrint'">普通打印</a-button>
            <a-button v-if="billType === '零售退货入库'" v-print="'#retailBackPrint'">普通打印</a-button>
            <a-button v-if="billType === '采购订单'" v-print="'#purchaseOrderPrint'">普通打印</a-button>
            <a-button v-if="billType === '采购入库'" v-print="'#purchaseInPrint'">普通打印</a-button>
            <a-button v-if="billType === '采购退货出库'" v-print="'#purchaseBackPrint'">普通打印</a-button>
            <a-button v-if="billType === '销售订单' && model.status != 0" v-print="'#saleOrderPrint'">普通打印</a-button>
            <a-button v-if="billType === '销售草稿'" v-print="'#saleOrderPrintDraft'">普通打印</a-button>
            <a-button v-if="billType === '销售出库'" v-print="'#saleOutPrint'">普通打印</a-button>
            <a-button v-if="billType === '销售退货入库'" v-print="'#saleBackPrint'">普通打印</a-button>
            <a-button v-if="billType === '其它入库'" v-print="'#otherInPrint'">普通打印</a-button>
            <a-button v-if="billType === '其它出库'" v-print="'#otherOutPrint'">普通打印</a-button>
            <a-button v-if="billType === '调拨出库'" v-print="'#allocationOutPrint'">普通打印</a-button>
            <a-button v-if="billType === '组装单'" v-print="'#assemblePrint'">普通打印</a-button>
            <a-button v-if="billType === '拆卸单'" v-print="'#disassemblePrint'">普通打印</a-button>
            <a-button v-if="billType === '盘点录入'" v-print="'#stockCheckEnterPrint'">普通打印</a-button>
            <a-button v-if="billType === '盘点复盘'" v-print="'#stockCheckReplayPrint'">普通打印</a-button>
            <!--导出Excel-->
            <a-button v-if="billType === '零售出库' || billType === '零售退货入库'" @click="retailExportExcel()">导出</a-button>
            <a-button v-if="billType === '采购订单' || billType === '销售订单' || billType === '销售草稿'"
                @click="orderExportExcel()">导出</a-button>
            <a-button
                v-if="billType === '采购入库' || billType === '采购退货出库' || billType === '销售出库' || billType === '销售退货入库'"
                @click="purchaseSaleExportExcel()">导出</a-button>
            <a-button v-if="billType === '其它入库' || billType === '其它出库'" @click="otherExportExcel()">导出</a-button>
            <a-button v-if="billType === '调拨出库'" @click="allocationOutExportExcel()">导出</a-button>
            <a-button v-if="billType === '组装单' || billType === '拆卸单'" @click="assembleExportExcel()">导出</a-button>
            <a-button v-if="billType === '盘点复盘'" @click="stockCheckReplayExportExcel()">导出</a-button>
            <a-button v-if="billType === '盘点录入'" @click="stockCheckEnterExportExcel()">导出</a-button>

            <!--反审核-->
            <a-button v-if="checkFlag && isCanBackCheck && model.status === '1' && controlCheck('配货调拨', false)"
                @click="handleBackCheck()">反审核</a-button>
            <a-button key="back" @click="handleCancel">取消</a-button>
        </template>
        <a-form :form="form">
            <!--零售出库-->
            <template v-if="billType === '零售出库'">
                <section ref="print" id="retailOutPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="会员卡号">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款类型">
                                {{ model.payType }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="18" :md="12" :sm="24">
                            <div :style="tableWidthRetail">
                                <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false"
                                    :loading="loading" :columns="columns" :dataSource="dataSource">
                                    <template slot="customBarCode" slot-scope="text, record">
                                        <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                            {{ record.barCode }}
                                        </div>
                                        <a-popover placement="right" trigger="click">
                                            <template slot="content"><img
                                                    :src="getImgUrl(record.imgName, record.imgLarge)"
                                                    width="500px" /></template>
                                            <div class="item-info" v-if="record.imgName">
                                                <img v-if="record.imgName"
                                                    :src="getImgUrl(record.imgName, record.imgSmall)" class="item-img"
                                                    title="查看大图" />
                                            </div>
                                        </a-popover>
                                    </template>
                                </a-table>
                            </div>
                        </a-col>
                        <a-col :span="6">
                            <a-row class="form-row" :gutter="24">
                                <a-col :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据金额">
                                        {{ model.changeAmount }}
                                    </a-form-item>
                                </a-col>
                                <a-col v-show="model.yfkMoney > 0" :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="预付金额">
                                        {{ model.yfkMoney }}
                                    </a-form-item>
                                </a-col>
                                <a-col :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol"
                                        :label="model.payType == '扫码支付' || model.payType == '预付款' ? '扫码金额' : '收款金额'">
                                        {{ model.getAmount }}
                                    </a-form-item>
                                </a-col>
                                <a-col v-show="model.otherMoney > 0" :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="现金金额">
                                        {{ model.otherMoney }}
                                    </a-form-item>
                                </a-col>

                                <a-col :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零">
                                        {{ model.backAmount }}
                                    </a-form-item>
                                </a-col>
                                <a-col :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款账户">
                                        {{ model.accountName }}
                                    </a-form-item>
                                </a-col>
                                <a-col v-if="model.hasBackFlag" :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="退货单号">
                                        <template v-for="(item, index) in linkNumberList">
                                            <a @click="myHandleDetail(item.number)">{{ item.number }}</a><br />
                                        </template>
                                    </a-form-item>
                                </a-col>
                            </a-row>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--零售退货-->
            <template v-else-if="billType === '零售退货入库'">
                <section ref="print" id="retailBackPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="会员卡号">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
                                <a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="18" :md="12" :sm="24">
                            <div :style="tableWidthRetail">
                                <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false"
                                    :loading="loading" :columns="columns" :dataSource="dataSource">
                                    <template slot="customBarCode" slot-scope="text, record">
                                        <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                            {{ record.barCode }}
                                        </div>
                                        <a-popover placement="right" trigger="click">
                                            <template slot="content"><img
                                                    :src="getImgUrl(record.imgName, record.imgLarge)"
                                                    width="500px" /></template>
                                            <div class="item-info" v-if="record.imgName">
                                                <img v-if="record.imgName"
                                                    :src="getImgUrl(record.imgName, record.imgSmall)" class="item-img"
                                                    title="查看大图" />
                                            </div>
                                        </a-popover>
                                    </template>
                                </a-table>
                            </div>
                        </a-col>
                        <a-col :span="6">
                            <a-row class="form-row" :gutter="24">
                                <a-col :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据金额">
                                        {{ model.changeAmount }}
                                    </a-form-item>
                                </a-col>
                                <a-col :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款金额">
                                        {{ model.getAmount }}
                                    </a-form-item>
                                </a-col>
                                <a-col :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="找零">
                                        {{ model.backAmount }}
                                    </a-form-item>
                                </a-col>
                                <a-col :lg="24" :md="6" :sm="6">
                                    <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款账户">
                                        {{ model.accountName }}
                                    </a-form-item>
                                </a-col>
                            </a-row>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--采购订单-->
            <template v-else-if="billType === '采购订单'">
                <section ref="print" id="purchaseOrderPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <!-- <a-col :span="6">
              <a-form-item v-if="purchaseBySaleFlag" :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联订单">
                {{ model.linkNumber }}
              </a-form-item>
            </a-col> -->
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="采购人员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                            <template slot="customRenderReturnedStatus" slot-scope="text, record">
                                <template>
                                    <a-tag v-if="record.returnedStatus == '0'" color="green">正常</a-tag>
                                    <a-tag v-if="record.returnedStatus == '3'" color="red">部分退货</a-tag>
                                    <a-tag v-if="record.returnedStatus == '2'" color="blue">完全退货</a-tag>
                                </template>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠率">
                                {{ model.discount }}% </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款优惠">
                                {{ model.discountMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="优惠后金额">
                                {{ model.discountLastMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :lg="6" :md="12" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="装卸费">
                                {{ model.otherMoney2 }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户">
                                {{ model.accountName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="支付订金">
                                {{ model.changeAmount }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{
                                    xs: { span: 24 },
                                    sm: { span: 6 },
                                }" :wrapperCol="wrapperCol" label="供应商开卡行">
                                {{ model.accountNumber }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商账户">
                                {{ model.bankName }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="运费">
                                {{ model.freight }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--采购入库-->
            <template v-else-if="billType === '采购入库'">
                <section ref="print" id="purchaseInPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联订单">
                                <a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠率">
                                {{ model.discount }}% </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款优惠">
                                {{ model.discountMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="优惠后金额">
                                {{ model.discountLastMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="其它费用">
                                {{ model.otherMoney }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款账户">
                                {{ model.accountName }}
                            </a-form-item>
                        </a-col>
                        <a-col v-if="model.deposit" :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="扣除订金">
                                {{ model.deposit }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次付款">
                                {{ model.changeAmount }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次欠款">
                                {{ model.debt }}
                            </a-form-item>
                        </a-col>
                        <a-col v-if="model.hasBackFlag" :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="退货单号">
                                <template v-for="(item, index) in linkNumberList">
                                    <a @click="myHandleDetail(item.number)">{{ item.number }}</a><br />
                                </template>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col v-if="financialBillNoList.length" :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款单号">
                                <template v-for="(item, index) in financialBillNoList">
                                    <a @click="myHandleFinancialDetail(item.billNo)">{{ item.billNo }}</a><br />
                                </template>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="采购员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="运费">
                                {{ model.freight }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="装卸费">
                                {{ model.otherMoney2 }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--仓管入库-->
            <template v-else-if="billType === '仓管入库'">
                <section ref="print" id="purchaseInPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联订单">
                                <a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="采购员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--采购退货-->
            <template v-else-if="billType === '采购退货出库'">
                <section ref="print" id="purchaseBackPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
                                <a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠率">
                                {{ model.discount }}% </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="退款优惠">
                                {{ model.discountMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="优惠后金额">
                                {{ model.discountLastMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="其它费用">
                                {{ model.otherMoney }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户">
                                {{ model.accountName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次退款">
                                {{ model.changeAmount }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次欠款">
                                {{ model.debt }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6"> </a-col>
                    </a-row>
                </section>
            </template>
            <!--销售订单-->
            <template v-else-if="billType === '销售订单'">
                <section ref="print" id="saleOrderPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售人员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>

                            <template slot="customRenderXsthFlag" slot-scope="text, record">
                                <a-tag v-if="record.xsthFlag == '0'" color="green">正常</a-tag>
                                <a-tag v-if="record.xsthFlag == '1'" color="red">存在退货</a-tag>
                                <a-tag v-if="record.xsthFlag == '2'" color="blue">完全退货</a-tag>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠率">
                                {{ model.discount }}% </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款优惠">
                                {{ model.discountMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="优惠后金额">
                                {{ model.discountLastMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="收件人">
                                {{ model.addressee }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户">
                                {{ model.accountName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收取订金">
                                {{ model.changeAmount }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="联系电话">
                                {{ model.contact }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="收件地址">
                                {{ model.address }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="运费">
                                {{ model.freight }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="抖音核销金额">
                                {{ model.otherMoney3 }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="销售员手机号">
                                {{ model.saleManPhone }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="期望配送时间">
                                {{ model.deliverExpectedTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-col v-for="(itemObj, indexObj) in model.logisticsInformation" :key="indexObj" :span="12">
                                <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                    label="快递信息：">
                                    <a-popover v-for="(item, index) in itemObj.urls" :key="index" placement="right"
                                        trigger="click">
                                        <template slot="content"><img :src="getImgUrl(item, item)"
                                                width="500px" /></template>
                                        <div class="item-info" v-if="item">
                                            <img v-if="item" :src="getImgUrl(item, item)" class="item-img"
                                                title="查看大图" />
                                        </div>
                                    </a-popover>
                                </a-form-item>
                            </a-col>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
                <!-- 为三联打印专门设置的样式 -->
                <div v-show="false">
                    <section ref="print" id="saleOrderSanPrint" style="width: 1140px; font-size: 24px">
                        <a-row class="form-row" :gutter="24">
                            <a-col :span="8"> 客户：{{ model.organName }} </a-col>
                            <a-col :span="8"> 日期：{{ model.operTimeStr }} </a-col>
                            <a-col :span="8"> 编号：{{ model.number }} </a-col>
                        </a-row>
                        <a-row class="form-row" :gutter="24">
                            <a-col :span="8"> 优惠：{{ model.discountMoney }} </a-col>
                            <a-col :span="8"> 订金：{{ model.changeAmount }} </a-col>
                            <a-col :span="8"> 金额：{{ model.discountLastMoney }} </a-col>
                        </a-row>
                        <a-row class="form-row" :gutter="24">
                            <a-col :span="8"> 收件人：{{ model.addressee }} </a-col>
                            <a-col :span="8"> 账户：{{ model.accountName }} </a-col>
                            <a-col :span="8"> 销售员：{{ model.salesManStr }} </a-col>
                        </a-row>
                        <a-row class="form-row" :gutter="24">
                            <a-col :span="8"> 电话：{{ model.contact }} </a-col>
                        </a-row>
                        <a-row class="form-row" :gutter="24">
                            <a-col :lg="24" :md="24" :sm="24"> 地址：{{ model.address }} </a-col>
                        </a-row>
                        <a-row class="form-row" :gutter="24">
                            <a-col :lg="24" :md="24" :sm="24"> 备注：{{ model.remark }} </a-col>
                        </a-row>

                        <div :style="tableWidth" class="sanPrintClass">
                            <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false"
                                :loading="loading" :columns="columnsSan" :dataSource="dataSource" style="width: 1100px">
                                <template slot="customBarCode" slot-scope="text, record">
                                    <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                        {{ record.barCode }}
                                    </div>
                                    <!-- <a-popover placement="right" trigger="click">
                    <template slot="content"
                      ><img :src="getImgUrl(record.imgName, record.imgLarge)" width="500px"
                    /></template>
                    <div class="item-info" v-if="record.imgName">
                      <img
                        v-if="record.imgName"
                        :src="getImgUrl(record.imgName, record.imgSmall)"
                        class="item-img"
                        title="查看大图"
                      />
                    </div>
                  </a-popover> -->
                                </template>

                                <template slot="customRenderXsthFlag" slot-scope="text, record">
                                    <a-tag v-if="record.xsthFlag == '0'" color="green">正常</a-tag>
                                    <a-tag v-if="record.xsthFlag == '1'" color="red">存在退货</a-tag>
                                    <a-tag v-if="record.xsthFlag == '2'" color="blue">完全退货</a-tag>
                                </template>
                            </a-table>
                        </div>
                    </section>
                </div>
            </template>

            <!--销售草稿-->
            <template v-else-if="billType === '销售草稿'">
                <section ref="print" id="saleOrderPrintDraft">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}(草稿) </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售人员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode ? record.barCode + "(草稿)" : record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>

                            <template slot="customRenderXsthFlag" slot-scope="text, record">
                                <a-tag v-if="record.xsthFlag == '0'" color="green">正常</a-tag>
                                <a-tag v-if="record.xsthFlag == '1'" color="red">存在退货</a-tag>
                                <a-tag v-if="record.xsthFlag == '2'" color="blue">完全退货</a-tag>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠率">
                                {{ model.discount }}% </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="付款优惠">
                                {{ model.discountMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="优惠后金额">
                                {{ model.discountLastMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="收件人">
                                {{ model.addressee }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户">
                                {{ model.accountName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收取订金">
                                {{ model.changeAmount }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="联系电话">
                                {{ model.contact }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="收件地址">
                                {{ model.address }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="运费">
                                {{ model.freight }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="销售员手机号">
                                {{ model.saleManPhone }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="12">
                            <a-col v-for="(itemObj, indexObj) in model.logisticsInformation" :key="indexObj" :span="12">
                                <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                    label="快递信息：">
                                    <a-popover v-for="(item, index) in itemObj.urls" :key="index" placement="right"
                                        trigger="click">
                                        <template slot="content"><img :src="getImgUrl(item, item)"
                                                width="500px" /></template>
                                        <div class="item-info" v-if="item">
                                            <img v-if="item" :src="getImgUrl(item, item)" class="item-img"
                                                title="查看大图" />
                                        </div>
                                    </a-popover>
                                </a-form-item>
                            </a-col>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--销售出库-->
            <template v-else-if="billType === '销售出库'">
                <section ref="print" id="saleOutPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联订单">
                                <a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠率">
                                {{ model.discount }}% </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款优惠">
                                {{ model.discountMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="优惠后金额">
                                {{ model.discountLastMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="其它费用">
                                {{ model.otherMoney }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户">
                                {{ model.accountName }}
                            </a-form-item>
                        </a-col>
                        <a-col v-if="model.deposit" :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="扣除订金">
                                {{ model.deposit }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次收款">
                                {{ model.changeAmount }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次欠款">
                                {{ model.debt }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="运费类型">
                                {{ model.freightSettlementType == 1 ? "客户承担" : "公司承担" }}
                            </a-form-item>
                        </a-col>
                        <a-col v-if="model.hasBackFlag" :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="退货单号">
                                <template v-for="(item, index) in linkNumberList">
                                    <a @click="myHandleDetail(item.number)">{{ item.number }}</a><br />
                                </template>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售人员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                        <a-col v-if="financialBillNoList.length" :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收款单号">
                                <template v-for="(item, index) in financialBillNoList">
                                    <a @click="myHandleFinancialDetail(item.billNo)">{{ item.billNo }}</a><br />
                                </template>
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收件人">
                                {{ model.addressee }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="联系电话">
                                {{ model.contact }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收件地址">
                                {{ model.address }}
                            </a-form-item>
                        </a-col>
                    </a-row>

                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="抖音核销金额">
                                {{ model.otherMoney3 }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="快递信息：">
                                <a-popover v-for="(item, index) in model.logisticsInformation.urls" :key="index"
                                    placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(item, item)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="item">
                                        <img v-if="item" :src="getImgUrl(item, item)" class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="期望配送时间">
                                {{ model.deliverExpectedTimeStr }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--销售退货-->
            <template v-else-if="billType === '销售退货入库'">
                <section ref="print" id="saleBackPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
                                <a @click="myHandleDetail(model.linkNumber)">{{ model.linkNumber }}</a>
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="优惠率">
                                {{ model.discount }}% </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="退款优惠">
                                {{ model.discountMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="优惠后金额">
                                {{ model.discountLastMoney }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="其它费用">
                                {{ model.otherMoney }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="结算账户">
                                {{ model.accountName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次退款">
                                {{ model.changeAmount }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="本次欠款">
                                {{ model.debt }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="销售人员">
                                {{ model.salesManStr }}
                            </a-form-item>
                        </a-col>
                    </a-row>

                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 6 } }" :wrapperCol="wrapperCol"
                                label="抖音核销金额">
                                {{ model.otherMoney3 }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--其它入库-->
            <template v-else-if="billType === '其它入库'">
                <section ref="print" id="otherInPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="供应商">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
                                {{ model.linkNumber }} {{ model.billType }} </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--其它出库-->
            <template v-else-if="billType === '其它出库'">
                <section ref="print" id="otherOutPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="客户">
                                <a-input v-decorator="['id']" hidden />
                                {{ model.organName }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
                                {{ model.linkNumber }} {{ model.billType }} </a-form-item>
                        </a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--调拨出库-->
            <template v-else-if="billType === '调拨出库'">
                <section ref="print" id="allocationOutPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6"></a-col>
                        <a-col :span="6"></a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>

            <!--调拨出库-->
            <template v-else-if="billType === '配货调拨'">
                <section ref="print" id="allocationOutPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6"></a-col>
                        <a-col :span="6"></a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--组装单-->
            <template v-else-if="billType === '组装单'">
                <section ref="print" id="assemblePrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6"></a-col>
                        <a-col :span="6"></a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--拆卸单-->
            <template v-else-if="billType === '拆卸单'">
                <section ref="print" id="disassemblePrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6"></a-col>
                        <a-col :span="6"></a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--盘点录入-->
            <template v-else-if="billType === '盘点录入'">
                <section ref="print" id="stockCheckEnterPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6"></a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <!--盘点复盘-->
            <template v-else-if="billType === '盘点复盘'">
                <section ref="print" id="stockCheckReplayPrint">
                    <a-row class="form-row" :gutter="24">
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据日期">
                                {{ model.operTimeStr }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="单据编号">
                                {{ model.number }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6">
                            <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="关联单据">
                                {{ model.linkNumber }}
                            </a-form-item>
                        </a-col>
                        <a-col :span="6"></a-col>
                    </a-row>
                    <div :style="tableWidth">
                        <a-table ref="table" size="middle" bordered rowKey="id" :pagination="false" :loading="loading"
                            :columns="columns" :dataSource="dataSource">
                            <template slot="customBarCode" slot-scope="text, record">
                                <div :style="record.imgName ? 'float:left;line-height:30px' : 'float:left;'">
                                    {{ record.barCode }}
                                </div>
                                <a-popover placement="right" trigger="click">
                                    <template slot="content"><img :src="getImgUrl(record.imgName, record.imgLarge)"
                                            width="500px" /></template>
                                    <div class="item-info" v-if="record.imgName">
                                        <img v-if="record.imgName" :src="getImgUrl(record.imgName, record.imgSmall)"
                                            class="item-img" title="查看大图" />
                                    </div>
                                </a-popover>
                            </template>
                        </a-table>
                    </div>
                    <a-row class="form-row" :gutter="24">
                        <a-col :lg="24" :md="24" :sm="24">
                            <a-form-item :labelCol="labelCol" :wrapperCol="{ xs: { span: 24 }, sm: { span: 24 } }"
                                label="" style="padding: 20px 10px">
                                {{ model.remark }}
                            </a-form-item>
                        </a-col>
                    </a-row>
                </section>
            </template>
            <template v-if="fileList && fileList.length > 0">
                <a-row class="form-row" :gutter="24">
                    <a-col :span="10">
                        <a-form-item :labelCol="{ xs: { span: 24 }, sm: { span: 3 } }"
                            :wrapperCol="{ xs: { span: 24 }, sm: { span: 21 } }" label="附件">
                            <j-upload v-model="fileList" bizPath="bill" :disabled="true"
                                :buttonVisible="false"></j-upload>
                        </a-form-item>
                    </a-col>
                    <a-col :span="14"></a-col>
                </a-row>
            </template>
        </a-form>
        <bill-print-iframe ref="modalDetail"></bill-print-iframe>
        <financial-detail ref="financialDetailModal"></financial-detail>
    </j-modal>
</template>

<script>
import pick from "lodash.pick";
import { getAction, postAction, getFileAccessHttpUrl } from "@/api/manage";
import { findBillDetailByNumber, findFinancialDetailByNumber, getPlatformConfigByKey, getCurrentSystemConfig } from "@/api/api";
import { getMpListShort, getCheckFlag, openDownloadDialog, sheet2blob } from "@/utils/util";
import BillPrintIframe from "./BillPrintIframe";
import FinancialDetail from "../../financial/dialog/FinancialDetail";
import JUpload from "@/components/jeecg/JUpload";
import Vue from "vue";
export default {
    name: "BillDetail",
    components: {
        BillPrintIframe,
        FinancialDetail,
        JUpload,
    },
    data() {
        return {
            title: "详情",
            width: "1600px",
            visible: false,
            modalStyle: "",
            model: {},
            isCanBackCheck: true,
            billType: "",
            billPrintFlag: false,
            fileList: [],
            purchaseBySaleFlag: false,
            linkNumberList: [],
            financialBillNoList: [],
            /* 原始反审核是否开启 */
            checkFlag: true,
            tableWidth: {
                width: "1500px",
            },
            tableWidthRetail: {
                width: "1150px",
            },
            labelCol: {
                xs: { span: 24 },
                sm: { span: 5 },
            },
            wrapperCol: {
                xs: { span: 24 },
                sm: { span: 16 },
            },

            form: this.$form.createForm(this),
            loading: false,
            dataSource: [],
            url: {
                detailList: "/depotItem/getDetailList",
                batchSetStatusUrl: "/depotHead/batchSetStatus",
            },
            //表头
            columns: [],
            columnsSan: [],
            //列定义
            defColumns: [],
            retailOutColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            retailBackColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            purchaseOrderColumns: [
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "已入库", dataIndex: "finishNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "税率(%)", dataIndex: "taxRate" },
                { title: "税额", dataIndex: "taxMoney" },
                { title: "价税合计", dataIndex: "taxLastMoney" },
                { title: "备注", dataIndex: "remark" },
            ],
            purchaseInColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "税率(%)", dataIndex: "taxRate" },
                { title: "税额", dataIndex: "taxMoney" },
                { title: "价税合计", dataIndex: "taxLastMoney" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            purchaseInColumnsTwo: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            purchaseBackColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "税率(%)", dataIndex: "taxRate" },
                { title: "税额", dataIndex: "taxMoney" },
                { title: "价税合计", dataIndex: "taxLastMoney" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            saleOrderColumns: [
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "已出库", dataIndex: "finishNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "退货状态", dataIndex: "xsthFlag" },
                // { title: '税率(%)', dataIndex: 'taxRate' },
                // { title: '税额', dataIndex: 'taxMoney' },
                // { title: '价税合计', dataIndex: 'taxLastMoney' },
                { title: "备注", dataIndex: "remark" },
            ],
            saleOutColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "税率(%)", dataIndex: "taxRate" },
                { title: "税额", dataIndex: "taxMoney" },
                { title: "价税合计", dataIndex: "taxLastMoney" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            saleBackColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "税率(%)", dataIndex: "taxRate" },
                { title: "税额", dataIndex: "taxMoney" },
                { title: "价税合计", dataIndex: "taxLastMoney" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            otherInColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "实盘库存", dataIndex: "realNumber" },
                { title: "盘前库存", dataIndex: "beforeNumber" },
                { title: "实时库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            otherOutColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "序列号", dataIndex: "snList" },
                { title: "批号", dataIndex: "batchNumber" },
                { title: "有效期", dataIndex: "expirationDate" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            allocationOutColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "调入仓库", dataIndex: "anotherDepotName" },
                { title: "单位", dataIndex: "unit" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            distributionAllocationOutColumns: [
                { title: "调入仓库", dataIndex: "anotherDepotName" },
                { title: "调出门店", dataIndex: "outTenantStr" },
                { title: "调出仓库", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                // { title: "型号", dataIndex: "model" },
                // { title: "颜色", dataIndex: "color" },
                // { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                // { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                // { title: "重量", dataIndex: "weight" },
                { title: "备注", dataIndex: "remark" },
            ],
            assembleColumns: [
                { title: "商品类型", dataIndex: "mType" },
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "备注", dataIndex: "remark" },
            ],
            disassembleColumns: [
                { title: "商品类型", dataIndex: "mType" },
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "颜色", dataIndex: "color" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "备注", dataIndex: "remark" },
            ],
            stockCheckEnterColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "备注", dataIndex: "remark" },
            ],
            stockCheckReplayColumns: [
                { title: "仓库名称", dataIndex: "depotName" },
                { title: "条码", dataIndex: "barCode" },
                { title: "名称", dataIndex: "name" },
                { title: "规格", dataIndex: "standard" },
                { title: "型号", dataIndex: "model" },
                { title: "扩展信息", dataIndex: "materialOther" },
                { title: "库存", dataIndex: "stock" },
                { title: "单位", dataIndex: "unit" },
                { title: "多属性", dataIndex: "sku" },
                { title: "数量", dataIndex: "operNumber" },
                { title: "单价", dataIndex: "unitPrice" },
                { title: "金额", dataIndex: "allPrice" },
                { title: "备注", dataIndex: "remark" },
            ],
        };
    },
    created() {
        let realScreenWidth = window.screen.width;
        this.width = realScreenWidth < 1500 ? "1200px" : "1550px";
        this.tableWidth = {
            width: realScreenWidth < 1500 ? "1150px" : "1500px",
        };
        this.tableWidthRetail = {
            width: realScreenWidth < 1500 ? "800px" : "1100px",
        };
    },
    methods: {
        // 零售出库小票打印
        onPrint() {
            let txt = "";
            this.dataSource.map((value) => {
                if (value.barCode) {
                    txt += `<div class="print_content print_fontSmall">
				<div class="print_widthBig print_paddingLeft">${value.name}</div>
				<div class="print_widthSmall print_center">${value.operNumber}</div>
				<div class="print_widthSmall print_center">${value.allPrice}</div>
			</div>`;
                }
            });
            // 将打印页面设置为内框架内容
            const newIframe = document.createElement("iframe");
            newIframe.setAttribute("style", "width:0px;height:0px;position:absolute;left:-9999px;top:-9999px;");
            newIframe.setAttribute("align", "center");
            document.body.appendChild(newIframe);
            let doc = null;
            doc = newIframe.contentWindow.document;
            doc.write(`
    <style type="text/css">
      /* 浏览器打印基本样式 */
      @media print {
        @page {
          size: auto;
          margin: 0mm; /* 影响打印小票的边缘margin */
          table { page-break-after: auto; }
          tr    { page-break-inside: avoid; page-break-after: auto; }
          td    { page-break-inside: avoid; page-break-after: auto; }
          thead { display: table-header-group; }
          tfoot { display: table-footer-group; }
        }
      }
      /* 打印页面样式 */
  .print_box {width: 100%;height: auto;margin: 0px auto;font-size: 10px;line-height: 16px;}

	.print_title {width: 100%;text-align: center;font-size: 14px;font-weight: bold;line-height: 24px;}

	.print_content {width: 100%;display: flex;}

	.print_widthBig {width: 60%;}

	.print_widthSmall {width: 20%;}

  .print_fontSmall{font-size: 8px;}
  .print_paddingLeft{padding-left: 2px;}

	.print_foot {display: flex;justify-content: space-between;}
  .print_center {text-align: center;}

	.divide_line {justify-content: center;border-bottom: 1px dashed rgba(51, 51, 51, 1);}
      /* 打印页面样式，一个class一个class写，可以.classA .classB {}, 但不要嵌套，不要.classA { .classB {} } */
    </style>
    <div class="print_box">
			<div class="print_title">小贰家</div>
			<div class="divide_line"></div>
			<div>单据编号:${this.model.number}</div>
			<div>单据时间:${this.model.operTimeStr}</div>
			<div class="divide_line"></div>
			<div class="print_content">
				<div class="print_widthBig print_center">品名</div>
				<div class="print_widthSmall print_center">数量</div>
				<div class="print_widthSmall print_center">小计</div>
			</div>
			<div class="divide_line"></div>
      ${txt}
			<div class="divide_line"></div>
			<div class="print_foot">
				<div>单据金额:${this.model.changeAmount}</div>
			</div>
			<div class="print_foot">
				<div>收款金额:${this.model.getAmount}</div>
			</div>
			<div class="divide_line"></div>
			<div style="text-align: center;line-height: 24px;">该票为购物凭证，请妥善保存！</div>
		</div>
    </div>`);
            doc.close();
            // 浏览器打印页面打开渲染
            setTimeout(() => {
                newIframe.contentWindow.focus();
                newIframe.contentWindow.print();
                document.body.removeChild(newIframe); // 移除打印内框架，下次打印下次再挂载
            }, 10);
        },

        initSetting(record, type, ds) {
            if (type === "零售出库") {
                this.defColumns = this.retailOutColumns;
            } else if (type === "零售退货入库") {
                this.defColumns = this.retailBackColumns;
            } else if (type === "采购订单") {
                this.defColumns = this.purchaseOrderColumns;
            } else if (type === "采购入库") {
                this.defColumns = this.purchaseInColumns;
            } else if (type === "仓管入库") {
                this.defColumns = this.purchaseInColumnsTwo;
            } else if (type === "采购退货出库") {
                this.defColumns = this.purchaseBackColumns;
            } else if (type === "销售订单") {
                this.defColumns = this.saleOrderColumns;
            } else if (type === "销售草稿") {
                this.defColumns = this.saleOrderColumns;
            } else if (type === "销售出库") {
                this.defColumns = this.saleOutColumns;
            } else if (type === "销售退货入库") {
                this.defColumns = this.saleBackColumns;
            } else if (type === "其它入库") {
                this.defColumns = this.otherInColumns;
            } else if (type === "其它出库") {
                this.defColumns = this.otherOutColumns;
            } else if (type === "调拨出库") {
                this.defColumns = this.allocationOutColumns;
            } else if (type == "配货调拨") {
                this.defColumns = this.distributionAllocationOutColumns;
            } else if (type === "组装单") {
                this.defColumns = this.assembleColumns;
            } else if (type === "拆卸单") {
                this.defColumns = this.disassembleColumns;
            } else if (type === "盘点录入") {
                this.defColumns = this.stockCheckEnterColumns;
            } else if (type === "盘点复盘") {
                this.defColumns = this.stockCheckReplayColumns;
            }
            //判断序列号、批号、有效期、多属性是否有值
            let needAddkeywords = [];
            for (let i = 0; i < ds.length; i++) {
                if (ds[i].snList) {
                    needAddkeywords.push("snList");
                }
                if (ds[i].batchNumber) {
                    needAddkeywords.push("batchNumber");
                }
                if (ds[i].expirationDate) {
                    needAddkeywords.push("expirationDate");
                }
                if (ds[i].sku) {
                    needAddkeywords.push("sku");
                }
                if (ds[i].weight) {
                    needAddkeywords.push("weight");
                }
            }
            if (record.status === "3") {
                //部分采购|部分销售的时候显示全部列
                this.columns = this.defColumns;
            } else if (record.purchaseStatus === "3") {
                //将已出库的标题转为已采购，针对销售订单转采购订单的场景
                let currentCol = [];
                for (let i = 0; i < this.defColumns.length; i++) {
                    let info = {};
                    info.title = this.defColumns[i].title;
                    info.dataIndex = this.defColumns[i].dataIndex;
                    if (this.defColumns[i].dataIndex === "finishNumber") {
                        info.title = "已采购";
                    }
                    if (this.defColumns[i].dataIndex === "barCode") {
                        info.scopedSlots = { customRender: "customBarCode" };
                    }
                    if (this.defColumns[i].dataIndex === "xsthFlag") {
                        info.scopedSlots = { customRender: "customRenderXsthFlag" };
                    }
                    currentCol.push(info);
                }

                this.columns = currentCol;
            } else {
                let currentCol = [];
                let currentColSan = [];
                for (let i = 0; i < this.defColumns.length; i++) {
                    //移除列
                    let needRemoveKeywords = ["finishNumber", "snList", "batchNumber", "expirationDate", "sku", "weight"];
                    if (needRemoveKeywords.indexOf(this.defColumns[i].dataIndex) === -1) {
                        let info = {};
                        info.title = this.defColumns[i].title;
                        info.dataIndex = this.defColumns[i].dataIndex;
                        if (this.defColumns[i].dataIndex === "barCode") {
                            info.scopedSlots = { customRender: "customBarCode" };
                        }
                        if (this.defColumns[i].dataIndex === "xsthFlag") {
                            info.scopedSlots = { customRender: "customRenderXsthFlag" };
                        }
                        currentCol.push(info);
                    }
                    //移除打印列
                    let needRemoveKeywordSans = ["xsthFlag", "stock", "materialOther", "color", "model", "finishNumber", "snList", "batchNumber", "expirationDate", "sku", "weight"];
                    if (needRemoveKeywordSans.indexOf(this.defColumns[i].dataIndex) === -1) {
                        let info = {};
                        info.title = this.defColumns[i].title;
                        info.dataIndex = this.defColumns[i].dataIndex;
                        if (this.defColumns[i].dataIndex === "barCode") {
                            info.scopedSlots = { customRender: "customBarCode" };
                        }
                        if (this.defColumns[i].dataIndex === "xsthFlag") {
                            info.scopedSlots = { customRender: "customRenderXsthFlag" };
                        }
                        currentColSan.push(info);
                    }

                    //添加有数据的列
                    if (needAddkeywords.indexOf(this.defColumns[i].dataIndex) > -1) {
                        let info = {};
                        info.title = this.defColumns[i].title;
                        info.dataIndex = this.defColumns[i].dataIndex;
                        currentCol.push(info);

                        currentColSan.push(info);
                    }
                }
                this.columns = currentCol;

                // 三连打印备注宽度调大
                currentColSan.map((value) => {
                    if (value.dataIndex === "remark") {
                        value["width"] = 280;
                    }
                });

                this.columnsSan = currentColSan;
            }
        },
        initPlatform() {
            getPlatformConfigByKey({ platformKey: "bill_print_flag" }).then((res) => {
                if (res && res.code === 200) {
                    if (this.billType === "零售出库" || this.billType === "零售退货入库" || this.billType === "采购订单" || this.billType === "采购入库" || this.billType === "采购退货出库" || this.billType === "销售订单" || this.billType === "销售出库" || this.billType === "销售退货入库") {
                        this.billPrintFlag = res.data.platformValue === "1" ? true : false;
                    }
                }
            });
        },
        getSystemConfig() {
            getCurrentSystemConfig().then((res) => {
                if (res.code === 200 && res.data) {
                    this.purchaseBySaleFlag = res.data.purchaseBySaleFlag === "1" ? true : false;
                    let multiBillType = res.data.multiBillType;
                    let multiLevelApprovalFlag = res.data.multiLevelApprovalFlag;
                    this.checkFlag = getCheckFlag(multiBillType, multiLevelApprovalFlag, this.prefixNo);
                }
            });
        },
        getBillListByLinkNumber(number) {
            getAction("/depotHead/getBillListByLinkNumber", { number: number }).then((res) => {
                if (res && res.code === 200) {
                    this.linkNumberList = res.data;
                }
            });
        },
        getFinancialBillNoByBillId(billId) {
            getAction("/accountHead/getFinancialBillNoByBillId", { billId: billId }).then((res) => {
                if (res && res.code === 200) {
                    this.financialBillNoList = res.data;
                }
            });
        },
        show(record, type, prefixNo) {
            //查询单条单据信息
            findBillDetailByNumber({ number: record.number }).then((res) => {
                if (res && res.code === 200) {
                    if (res.data.logisticsInformation) {
                        res.data.logisticsInformation = JSON.parse(res.data.logisticsInformation);

                        if (Array.isArray(res.data.logisticsInformation)) {
                            let newArray = [];
                            res.data.logisticsInformation.map((value) => {
                                let obj = JSON.parse(value);
                                obj["urls"] = obj.imgName ? obj.imgName.split(",") : [];
                                newArray.push(obj);
                            });
                            res.data.logisticsInformation = newArray;
                        } else {
                            res.data.logisticsInformation["urls"] = res.data.logisticsInformation.imgName ? res.data.logisticsInformation.imgName.split(",") : [];
                        }
                    } else {
                        res.data.logisticsInformation = {
                            urls: [],
                        };
                    }

                    let item = res.data;
                    this.billType = type;
                    this.prefixNo = prefixNo;
                    //附件下载
                    this.fileList = item.fileName;
                    this.visible = true;
                    this.modalStyle = "top:20px;height: 95%;";
                    this.model = Object.assign({}, item);
                    if (this.model.backAmount) {
                        this.model.getAmount = (this.model.changeAmount + this.model.backAmount - this.model.otherMoney - this.model.yfkMoney).toFixed(2);
                    } else {
                        this.model.getAmount = (this.model.changeAmount - this.model.otherMoney - this.model.yfkMoney).toFixed(2);
                    }
                    // if (this.model.backAmount) {
                    //   this.model.getAmount = (this.model.changeAmount + this.model.backAmount - this.model.otherMoney).toFixed(2)
                    // } else {
                    //   this.model.getAmount = this.model.changeAmount - this.model.otherMoney
                    // }
                    this.model.debt = (this.model.discountLastMoney + this.model.otherMoney - (this.model.deposit + this.model.changeAmount)).toFixed(2);
                    this.$nextTick(() => {
                        this.form.setFieldsValue(pick(this.model, "id"));
                    });
                    let showType = "basic";
                    if (item.status === "3") {
                        showType = "basic";
                    } else if (item.purchaseStatus === "3") {
                        showType = "purchase";
                    }
                    let params = {
                        headerId: this.model.id,
                        mpList: getMpListShort(Vue.ls.get("materialPropertyList")), //扩展属性
                        linkType: showType,
                        isReadOnly: "1",
                    };
                    if (this.billType == "配货调拨") {
                        params.tenantId = Vue.ls.get("Login_Userinfo").tenantId;
                    }
                    let url = this.readOnly ? this.url.detailList : this.url.detailList;
                    this.requestSubTableData(item, type, url, params);
                    this.initPlatform();
                    this.getSystemConfig();
                    this.getBillListByLinkNumber(this.model.number);
                    this.getFinancialBillNoByBillId(this.model.id);
                }
            });
        },
        controlCheck(type, isShow = false) {
            let types = [];
            if (typeof type === "string") {
                types = [type];
            } else if (Array.isArray(type)) {
                types = [].concat(type);
            }
            let typeList = ["配货调拨"];
            // 只要typeList中含有types的其中一项, 那么取值就是isShow
            return types.some((item) => typeList.includes(item)) ? isShow : false;
        },
        requestSubTableData(record, type, url, params, success) {
            this.loading = true;
            getAction(url, params)
                .then((res) => {
                    if (res && res.code === 200) {
                        this.dataSource = res.data.rows;
                        this.initSetting(record, type, this.dataSource);
                        typeof success === "function" ? success(res) : "";
                    }
                })
                .finally(() => {
                    this.loading = false;
                });
        },
        handleBackCheck() {
            let that = this;
            this.$confirm({
                title: "确认操作",
                content: "是否对该单据进行反审核?",
                onOk: function () {
                    that.loading = true;
                    postAction(that.url.batchSetStatusUrl, { status: "0", ids: that.model.id })
                        .then((res) => {
                            if (res.code === 200) {
                                that.$emit("ok");
                                that.loading = false;
                                that.close();
                            } else {
                                that.$message.warning(res.data.message);
                                that.loading = false;
                            }
                        })
                        .finally(() => {});
                },
            });
        },
        handleCancel() {
            this.close();
        },
        close() {
            this.$emit("close");
            this.visible = false;
            this.modalStyle = "";
        },
        myHandleDetail(billNumber) {
            findBillDetailByNumber({ number: billNumber }).then((res) => {
                if (res && res.code === 200) {
                    let type = res.data.type === "其它" ? "" : res.data.type;
                    this.show(res.data, res.data.subType + type);
                    this.title = res.data.subType + type + "-详情";
                }
            });
        },
        myHandleFinancialDetail(billNo) {
            let that = this;
            findFinancialDetailByNumber({ billNo: billNo }).then((res) => {
                if (res && res.code === 200) {
                    if (that.$refs.financialDetailModal) {
                        that.$refs.financialDetailModal.show(res.data, res.data.type);
                        that.$refs.financialDetailModal.title = res.data.type + "-详情";
                    }
                }
            });
        },
        getImgUrl(imgName, type) {
            if (imgName && imgName.split(",")) {
                type = type ? type + "/" : "";
                return getFileAccessHttpUrl("systemConfig/static/" + imgName.split(",")[0]);
            } else {
                return "";
            }
        },
        //三联打印预览
        handlePrint() {
            getPlatformConfigByKey({ platformKey: "bill_print_url" }).then((res) => {
                if (res && res.code === 200) {
                    let billPrintUrl = res.data.platformValue + "?no=" + this.model.number;
                    let billPrintHeight = this.dataSource.length * 50 + 600;
                    this.$refs.modalDetail.show(this.model, billPrintUrl, billPrintHeight);
                    this.$refs.modalDetail.title = this.billType + "-三联打印预览";
                }
            });
        },
        //零售出库|零售退货入库
        retailExportExcel() {
            let aoa = [];
            aoa = [["会员卡号：", this.model.organName, "", "单据日期：", this.model.operTimeStr, "", "单据编号：", this.model.number], []];
            let title = ["仓库名称", "条码", "名称", "规格", "型号", "颜色", "扩展信息", "库存", "单位", "序列号", "批号", "有效期", "多属性", "数量", "单价", "金额", "备注"];
            aoa.push(title);
            for (let i = 0; i < this.dataSource.length; i++) {
                let ds = this.dataSource[i];
                let item = [ds.depotName, ds.barCode, ds.name, ds.standard, ds.model, ds.color, ds.materialOther, ds.stock, ds.unit, ds.snList, ds.batchNumber, ds.expirationDate, ds.sku, ds.operNumber, ds.unitPrice, ds.allPrice, ds.remark];
                aoa.push(item);
            }
            openDownloadDialog(sheet2blob(aoa), this.billType + "_" + this.model.number);
        },
        //采购订单|销售订单
        orderExportExcel() {
            let aoa = [];
            let finishType = "";
            let organType = "";
            if (this.billType === "采购订单") {
                finishType = "已入库";
                organType = "供应商：";
            } else if (this.billType === "销售订单" || this.billType === "销售草稿") {
                finishType = "已出库";
                organType = "客户：";
            }
            aoa = [[organType, this.model.organName, "", "单据日期：", this.model.operTimeStr, "", "单据编号：", this.model.number], []];
            let title = ["条码", "名称", "规格", "型号", "颜色", "扩展信息", "库存", "单位", "多属性", "数量", finishType, "单价", "金额", "税率(%)", "税额", "价税合计", "备注"];
            aoa.push(title);
            for (let i = 0; i < this.dataSource.length; i++) {
                let ds = this.dataSource[i];
                let item = [ds.barCode, ds.name, ds.standard, ds.model, ds.color, ds.materialOther, ds.stock, ds.unit, ds.sku, ds.operNumber, ds.finishNumber, ds.unitPrice, ds.allPrice, ds.taxRate, ds.taxMoney, ds.taxLastMoney, ds.remark];
                aoa.push(item);
            }
            openDownloadDialog(sheet2blob(aoa), this.billType + "_" + this.model.number);
        },
        //采购入库|采购退货出库|销售出库|销售退货入库
        purchaseSaleExportExcel() {
            let aoa = [];
            let organType = "";
            if (this.billType === "采购入库" || this.billType === "采购退货出库") {
                organType = "供应商：";
            } else if (this.billType === "销售出库" || this.billType === "销售退货入库") {
                organType = "客户：";
            }
            aoa = [[organType, this.model.organName, "", "单据日期：", this.model.operTimeStr, "", "单据编号：", this.model.number, "", "关联单号：", this.model.linkNumber], []];
            let title = ["仓库名称", "条码", "名称", "规格", "型号", "颜色", "扩展信息", "库存", "单位", "序列号", "批号", "有效期", "多属性", "数量", "单价", "金额", "税率(%)", "税额", "价税合计", "重量", "备注"];
            aoa.push(title);
            for (let i = 0; i < this.dataSource.length; i++) {
                let ds = this.dataSource[i];
                let item = [ds.depotName, ds.barCode, ds.name, ds.standard, ds.model, ds.color, ds.materialOther, ds.stock, ds.unit, ds.snList, ds.batchNumber, ds.expirationDate, ds.sku, ds.operNumber, ds.unitPrice, ds.allPrice, ds.taxRate, ds.taxMoney, ds.taxLastMoney, ds.weight, ds.remark];
                aoa.push(item);
            }
            openDownloadDialog(sheet2blob(aoa), this.billType + "_" + this.model.number);
        },
        //其它入库|其它出库
        otherExportExcel() {
            let aoa = [];
            let organType = "";
            if (this.billType === "其它入库") {
                organType = "供应商：";
            } else if (this.billType === "其它出库") {
                organType = "客户：";
            }
            aoa = [[organType, this.model.organName, "", "单据日期：", this.model.operTimeStr, "", "单据编号：", this.model.number], []];
            let title = ["仓库名称", "条码", "名称", "规格", "型号", "颜色", "扩展信息", "库存", "单位", "序列号", "批号", "有效期", "多属性", "数量", "单价", "金额", "备注"];
            aoa.push(title);
            for (let i = 0; i < this.dataSource.length; i++) {
                let ds = this.dataSource[i];
                let item = [ds.depotName, ds.barCode, ds.name, ds.standard, ds.model, ds.color, ds.materialOther, ds.stock, ds.unit, ds.snList, ds.batchNumber, ds.expirationDate, ds.sku, ds.operNumber, ds.unitPrice, ds.allPrice, ds.remark];
                aoa.push(item);
            }
            openDownloadDialog(sheet2blob(aoa), this.billType + "_" + this.model.number);
        },
        //调拨出库
        allocationOutExportExcel() {
            let aoa = [];
            aoa = [["单据日期：", this.model.operTimeStr, "", "单据编号：", this.model.number], []];
            let title = ["仓库名称", "条码", "名称", "规格", "型号", "颜色", "扩展信息", "库存", "调入仓库", "单位", "多属性", "数量", "单价", "金额", "备注"];
            aoa.push(title);
            for (let i = 0; i < this.dataSource.length; i++) {
                let ds = this.dataSource[i];
                let item = [ds.depotName, ds.barCode, ds.name, ds.standard, ds.model, ds.color, ds.materialOther, ds.stock, ds.anotherDepotName, ds.unit, ds.sku, ds.operNumber, ds.unitPrice, ds.allPrice, ds.remark];
                aoa.push(item);
            }
            openDownloadDialog(sheet2blob(aoa), this.billType + "_" + this.model.number);
        },
        //组装单|拆卸单
        assembleExportExcel() {
            let aoa = [];
            aoa = [["单据日期：", this.model.operTimeStr, "", "单据编号：", this.model.number], []];
            let title = ["商品类型", "仓库名称", "条码", "名称", "规格", "型号", "颜色", "扩展信息", "库存", "单位", "多属性", "数量", "单价", "金额", "备注"];
            aoa.push(title);
            for (let i = 0; i < this.dataSource.length; i++) {
                let ds = this.dataSource[i];
                let item = [ds.mType, ds.depotName, ds.barCode, ds.name, ds.standard, ds.model, ds.color, ds.materialOther, ds.stock, ds.unit, ds.sku, ds.operNumber, ds.unitPrice, ds.allPrice, ds.remark];
                aoa.push(item);
            }
            openDownloadDialog(sheet2blob(aoa), this.billType + "_" + this.model.number);
        },
        //盘点录入
        stockCheckEnterExportExcel() {
            let aoa = [];
            aoa = [["单据日期：", this.model.operTimeStr, "", "单据编号：", this.model.number], []];
            let title = ["仓库名称", "条码", "名称", "规格", "型号", "扩展信息", "库存", "单位", "多属性", "数量", "单价", "金额", "备注"];
            aoa.push(title);
            for (let i = 0; i < this.dataSource.length; i++) {
                let ds = this.dataSource[i];
                let item = [ds.depotName, ds.barCode, ds.name, ds.standard, ds.model, ds.materialOther, ds.stock, ds.unit, ds.sku, ds.operNumber, ds.unitPrice, ds.allPrice, ds.remark];
                aoa.push(item);
            }
            openDownloadDialog(sheet2blob(aoa), this.billType + "_" + this.model.number);
        },
        //盘点复盘
        stockCheckReplayExportExcel() {
            let aoa = [];
            aoa = [["单据日期：", this.model.operTimeStr, "", "单据编号：", this.model.number, "", "关联单据：", this.model.linkNumber], []];
            let title = ["仓库名称", "条码", "名称", "规格", "型号", "扩展信息", "库存", "单位", "多属性", "数量", "单价", "金额", "备注"];
            aoa.push(title);
            for (let i = 0; i < this.dataSource.length; i++) {
                let ds = this.dataSource[i];
                let item = [ds.depotName, ds.barCode, ds.name, ds.standard, ds.model, ds.materialOther, ds.stock, ds.unit, ds.sku, ds.operNumber, ds.unitPrice, ds.allPrice, ds.remark];
                aoa.push(item);
            }
            openDownloadDialog(sheet2blob(aoa), this.billType + "_" + this.model.number);
        },
    },
};
</script>

<style scoped>
.item-info {
    float: left;
    width: 30px;
    height: 30px;
    margin-left: 8px;
}
.item-img {
    cursor: pointer;
    position: static;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.print-wrap {
    height: 20px;
    overflow-y: scroll;
}

.sanPrintClass >>> .ant-table-header-column {
    font-size: 20px;
}
.sanPrintClass >>> .ant-table-tbody {
    font-size: 20px;
}
.sanPrintClass >>> .ant-table-body table {
    border-collapse: collapse;
}
.sanPrintClass >>> .ant-table-bordered .ant-table-tbody > tr > td {
    border: 1px solid #000 !important;
}
.sanPrintClass >>> .ant-table-bordered .ant-table-thead > tr > th {
    border: 1px solid #000 !important;
}
</style>
